package IC.LIR;

public class LirUpType {
	
	private String lirCode;
	private String immediateOrMemory;
	private int fieldOffset;
	private int arrayReg;
	private int indexReg;
	private boolean isRegister = true;
	
	public LirUpType(String lirCode){
		this.lirCode = lirCode;
	}
	
	public LirUpType(String lirCode, boolean isRegister) {
		this(lirCode);
		this.isRegister = isRegister;
	}
	
	public LirUpType(String lirCode, String immediateOrMemory, boolean isRegister){
		this.lirCode = lirCode;
		this.immediateOrMemory = immediateOrMemory;
		this.isRegister = isRegister;
	}
	
	public LirUpType(String lirCode, int fieldOffset){
		this.lirCode = lirCode;
		this.fieldOffset = fieldOffset;
	}
	
	public LirUpType(String lirCode, int arrayReg, int indexReg, boolean isRegister){
		this.lirCode = lirCode;
		this.arrayReg = arrayReg;
		this.indexReg = indexReg;
		this.isRegister = isRegister;
	}

	public String getLirCode() {
		return lirCode;
	}

	public void setLirCode(String lirCode) {
		this.lirCode = lirCode;
	}
	

	public String getImmediateOrMemory() {
		return immediateOrMemory;
	}

	public void setFieldOffset(int fieldOffset) {
		this.fieldOffset = fieldOffset;
	}

	public int getFieldOffset() {
		return fieldOffset;
	}
	
	public boolean getIsRegister(){
		return isRegister;
	}
	
	public int getArrayRegNum(){
		return arrayReg;
	}
	
	public int getArrayIndexRegNum(){
		return indexReg;
	}
}